<template>
    <MkDialog ref='drawerRef' width="1000px" title="操作记录" buttons="close">
        <MkQueryContainer>
            <template #header="">
                <MkForm ref="queryForm" :model="searchParam" :inline="true">
                    <MkInput label="关键字" @keyup.enter.native="search" v-model="searchParam.keyword" clearable="" />
                    <el-form-item>
                        <MkButtonQuery @click="search"> </MkButtonQuery>
                    </el-form-item>
                </MkForm>
            </template>
            <MkTable :data="tableData" v-loading="loading">
                <MkColumnIndex />
                <MkColumn prop="entityId" label="单号" />
                <MkColumn prop="mingCheng" label="操作名称" />
                <MkColumn prop="caoZuoHouZhuangTai" label="操作后状态" />
                <MkColumn prop="caoZuoRen" label="操作人" />
                <MkColumn prop="caoZuoShiJian" label="操作时间" min-width="150" />
                <MkColumn prop="neiRong" label="操作信息" min-width="220" />
            </MkTable>
            <MkPagination v-model:page="searchParam.page" v-model:pageSize="searchParam.pageSize" :total="total"
                @query="search" />
        </MkQueryContainer>
    </MkDialog>
</template>

<script lang='ts' setup>
// 血液入库单
import { OptBillApi, OptBillPageInput, OptBillOutput } from '/@/api/opt/OptBill';
import { usePageQuery } from '/@/hooks'
defineOptions({
    name: 'MkOptBill'
})

const props = defineProps({
    danJuLeiXing: { // 代码
        type: String,
        default: '',
    },
    entityId: {
        type: String,
        default: '',
    }
})

const drawerRef = ref();
const emits = defineEmits(['load'])
const { searchParam, total, tableData, loading, search } = usePageQuery<OptBillOutput, OptBillPageInput>(OptBillApi.page)

const open = async () => {
    drawerRef.value.show();
    searchParam.danJuLeiXing = props.danJuLeiXing;
    searchParam.entityId = props.entityId;
    search();
};

defineExpose({ open })

</script>

<style lang='scss' scoped></style>